package com.chukun.concurrency.singleton;

import com.chukun.concurrency.annotations.ThreadSafe;
import com.chukun.concurrency.annotations.UnRecommendWrite;

/**
 * 使用饿汉式创建单例对象,不会有线程安全的问题
 */
@ThreadSafe
@UnRecommendWrite
public class SingletonBuilder2 {

    private static SingletonBuilder2 instance = new SingletonBuilder2();
    private SingletonBuilder2(){}

    public static SingletonBuilder2 getInstance(){
        return instance;
    }
}
